<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 代码封装                 
        (function(){               //立即执行函数 在没有模块化语法之前用的多，现在用的少
            let a = 10;
            let b = 20;
            console.log(a + b)
        })() 

        console.log(a);
    </script>
</body>
</html>